jQuery(function($) {
	
});
function onCKeyup_unsign_number(domEle) {
    var state = validateNumber(domEle);
    domEle.value = domEle.value.replace(/\D/g, '');
    return state;
}
function validateNumber(el) {
    var value = el.value;
    value = value.replace(/[\d+]/ig, "");
    if (value.length > 0)
    {
        $(el).focus();
        return false;
    }
    return true;
}
var queryInfo = function(){
	var data = $("#goldRebateForm").serialize();
	$.ajax({
		type:"POST",
		url:ctx + "/admin/rebateDetail/rebateList",
		data:data,
		cache:false,
		success:function(data){
			$("#user-profile-1").html(data);
			$('[data-rel=tooltip]').tooltip();
		}
	});
}

var doInsert = function(){
	var data = $("#goldRebateForm").serialize();
	$.ajax({
		type:"POST",
		url:ctx + "/admin/rebateDetail/doInsert",
		data:data,
		cache:false,
		success:function(data){
			if(data.code == 0){
				alert(data.msg);
			}else {
				queryInfo();
				alert("入库成功");
			}
		}
	});
}